package com.lzy.cloud.ticket.train.util;

import com.lzy.cloud.ticket.train.response.BaseResponse;
import com.lzy.framework.core.ensure.Ensure;
import org.springframework.stereotype.Component;

@Component
public class ErrorUtil {

    public Boolean toError(BaseResponse baseResponse){
        Ensure.that(baseResponse.getCode().equals("-1")).isFalse("00010002");
        Ensure.that(baseResponse.getCode().equals("-2")).isFalse("00010002");
        Ensure.that(baseResponse.getCode().equals("-5")).isFalse("00010003");
        Ensure.that(baseResponse.getCode().equals("0001")).isFalse("00010004");
        Ensure.that(baseResponse.getCode().equals("0002")).isFalse("00010005");
        return true;
    }
}
